package com.hhlkeepalive.onePx;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import com.hhlkeepalive.utils.ActivityManager;

public class OnePxActivity extends Activity {
    private final  static String TAG="KeepAlive";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.e(TAG,"OnePxActivity--->onCreate");
        Window mWindow=getWindow();
        mWindow.setGravity(Gravity.LEFT|Gravity.TOP);
        WindowManager.LayoutParams layoutParams=mWindow.getAttributes();
        layoutParams.x=0;
        layoutParams.y=0;
        layoutParams.height=1;
        layoutParams.width=1;
        mWindow.setAttributes(layoutParams);
        ActivityManager.addDestroyActivity(this,getClass().getName());
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.e(TAG,"OnePxActivity--->onDestroy");
        ActivityManager.destroyActivity(getClass().getName());
    }
}
